package com.lingnan.tijian.controller;

import com.lingnan.tijian.domain.Setmeal;
import com.lingnan.tijian.domain.result.Result;
import com.lingnan.tijian.domain.vo.SetmealVO;
import com.lingnan.tijian.service.ISetmealService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@RequestMapping("/setmeal")
public class SetmealController
{
    @Autowired
    private ISetmealService setmealService;

    @GetMapping("/list")
    public Result<List<Setmeal>> selectSetmealList() {
        List<Setmeal> setmeals = setmealService.selectSetmealList();
        return Result.success(setmeals);
    }

    @GetMapping("/list/{id}")
    public Result<Setmeal> selectSetmealList(@PathVariable Long id) {
        Setmeal setmeal = setmealService.getById(id);
        return Result.success(setmeal);
    }


}
